#include "widget.h"
#include "ui_widget.h"
#include <QKeyEvent>
#include <QDebug>
Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);
}

void Widget::keyPressEvent(QKeyEvent *event)
{
    if(event->key()==Qt::Key_A) qDebug()<<"A按键被按下";
    if(event->key()==Qt::Key_B) qDebug()<<"B按键被按下";
    if(event->key()==Qt::Key_C&&event->modifiers()==Qt::ControlModifier) qDebug()<<"Ctrl+C按键被按下";
}

Widget::~Widget()
{
    delete ui;
}

